<!-- 经办人信息修改MAM -->
<div  style="margin: 2% 0px 0px 30%">
  <div class="easyui-panel" title="经办人编号查询" 
    data-options="iconCls:'icon-group'"
    style="max-width:400px;padding:30px 60px;">
    <div style="margin-bottom:20px">
      <input id="MAMId" class="easyui-textbox" 
      labelPosition="top" 
      data-options="prompt:'请输入经办人编号...',
      invalidMessage:'编号最长为8位且不为空',
      missingMessage:'编号最长为8位且不为空'" 
      style="width:100%;height:35px">
    </div>
    <div>
      <a href="javascript:MAMIdclick()" class="easyui-linkbutton" 
        iconCls="icon-ok" style="width:100%">查询
      </a>
    </div>
  </div>
</div>

<!-- 查询结束 -->

<!-- 隐藏页面 -->
<!-- 隐藏对话框 -->

<div class="easyui-dialog" title="经办人信息" closed="true" id="MAMdialog"
  data-options="iconCls:'icon-group',modal:true,draggable:false"
  style="width:1000px;height:600px">
  <div 
      style="margin:50px 0px 0px 100px;font-size: 40px">
      <form id="MAMform" method="post">
        <input type="hidden" name="aid" id="maaid">
        <div style="margin-bottom: 30px">
          编号:<input  name="ano" id="maano" 
          class="easyui-textbox"
          style="width: 200px;height:40px"
          data-options=""></input>
          &nbsp;
          姓名:<input  name="aname" id="maaname" 
          class="easyui-textbox"
          style="width: 200px;height:40px"
          data-options=""></input>
        </div>
        <div style="margin-bottom: 30px">
         性别:<select  class="easyui-combobox" name="asex" id="maasex" 
         data-options="panelHeight:'auto'" 
         style="width: 50px;height:40px">   
         <option value="男">男</option>   
         <option value="女">女</option> 
          </select>  
          &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
          电话:<input  name="aphone" id="maaphone" 
          class="easyui-textbox" 
          style="width: 200px;height:40px"
          data-options=""></input></td>
        </div>
         <div style="margin-bottom: 30px;">
          备注:<input  name="aremark" id="maaremark"
          multiline="true"
          class="easyui-textbox" 
          style="width: 500px;height:150px"
          data-options="" >

        </input>
        </div>
      </form>
    <a  href="javascript:MAMclickDelete()"
        class="easyui-linkbutton" 
        data-options="iconCls:'icon-user' "
         style="width: 150px;height: 40px;
            margin-left: 35%"  ><h1>修改</h1>
    </a>    
  </div>
</div>
<!-- 测试完成 -->

<script type="text/javascript">
function MAMIdclick() {
  
  $.post("../Agency/GetAgency", {
    ano: $('#MAMId').textbox('getValue')
  }, function(data) {
    if (data == ''){
      $.messager.alert('警告', '顾客编号无效');
      return ;
    }
    $('#MAMdialog').dialog('open');
    $("#maaid").val(data.aid);
    $("#maano").textbox('setValue', data.ano);
    $("#maano").textbox('textbox').css("font-size", "18pt");
    $("#maaname").textbox('setValue', data.aname);
    $("#maaname").textbox('textbox').css("font-size", "18pt");
    $("#maasex").combobox('setValue', data.asex);
    $("#maasex").combobox('textbox').css("font-size", "18pt");
    $("#maaphone").textbox('setValue', data.aphone);
    $("#maaphone").textbox('textbox').css("font-size", "18pt");
    $("#maaremark").textbox('setValue', data.aremark);
    $("#maaremark").textbox('textbox').css("font-size", "18pt");
  });
}
function MAMclickDelete(){
    if($("#maano").val().length>8||$("#maano").val().length==0) {
        $.messager.alert('提示', '编号不能长度大于8且不为空'); 
        return ;
    }
    if($("#maaname").val().length>8) {
        $.messager.alert('提示', '姓名不能长度大于8'); 
        return ;
    }
    if($("#maaphone").val().length>12) {
        $.messager.alert('提示', '电话不能长度大于12'); 
        return ;
    }
   
     if($("#maaremark").val().length>50) {
        $.messager.alert('提示', '备注不能长度大于50'); 
        return ;
    }
  $('#MAMform').form({    
    url:'../Agency/ModifyAgency',    
    onSubmit: function(){    
        // do some check    
        // return false to prevent submit;    
    },    
    success:function(data){    
        $.messager.alert('提示', data); 
        $('#MAMdialog').dialog('close'); 
    }    
});    
// submit the form    
$('#MAMform').submit();  

   
}
</script>